<html lang="en">
<head>
<meta charset="UTF-8">
<title>新增假日活动</title>
<meta name="viewport"
	content="width=device-width,initial-scale=1,maximum-scale=1.0" />
<#include "/view/admin/head.html"/>
<link rel="stylesheet" type="text/css"
	href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet" type="text/css"
	href="${base}/jstool/bootstrap-switch/css/bootstrap3/bootstrap-switch.min.css" />
<link rel="stylesheet" type="text/css"
	href="${base}//jstool/bootstrap-fileinput/css/fileinput.min.css" />
<script type="text/javascript"
	src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"
	src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript"
	src="${base}/jstool/bootstrap-switch/js/bootstrap-switch.min.js"></script>
<script type="text/javascript"
	src="${base}/jstool/bootstrap-fileinput/js/fileinput.min.js"></script>
<script type="text/javascript"
	src="${base}/jstool/bootstrap-fileinput/js/locals/zh.js"></script>
<link rel="stylesheet" type="text/css"
	href="${base}/jstool/silviomoreto-bootstrap-select20151109/dist/css/bootstrap-select.css.map" />
<link rel="stylesheet" type="text/css"
	href="${base}/jstool/silviomoreto-bootstrap-select20151109/dist/css/bootstrap-select.css"/>
 <script type=" text/javascript"
 	 src="${base}/jstool/silviomoreto-bootstrap-select20151109/dist/js/bootstrap-select.min.js"></script>
<!-- <script type="text/javascript"
	src="${base}/jstool/silviomoreto-bootstrap-select20151109/dist/js/bootstrap-select.js.map"></script> -->
<script type="text/javascript"
	src="${base}/jstool/silviomoreto-bootstrap-select20151109/dist/js/i18n/defaults-zh_CN.min.js"></script>
<style type="text/css">
  .list-path {
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;
        }

        .table-class {
            width: 90%;
            text-align: center;
            border: 1px solid #afd9ee;
            margin: 0 auto;
            margin-top: 50px;
        }

        table th {
            width: 20%;
            background-color: #d9edf7;
            text-align: right;
        }

        table td {
            width: 20%;
            text-align: left;
        }
</style>



<script type="text/javascript">
	$(function() {
		var picker1 = $('#datetimepicker1').datetimepicker({
			format : 'YYYY-MM-DD',
			locale : moment.locale('zh-cn'),
		//minDate: '2016-7-1'  
		});
		var picker2 = $('#datetimepicker2').datetimepicker({
			format : 'YYYY-MM-DD',
			locale : moment.locale('zh-cn')
		});
		//动态设置最小值  
		picker1.on('dp.change', function(e) {
			picker2.data('DateTimePicker').minDate(e.date);
		});
		//动态设置最大值  
		picker2.on('dp.change', function(e) {
			picker1.data('DateTimePicker').maxDate(e.date);
		});
	});
	
	
	function validateWord(){
		
			var length=$("input[name='festName']").val().length;
			if(length>5){
				
				$("input[name='festName']").val("");
				alert("活动主题只能输入5个字");
			}
	}
	
</script>

</head>
<script>
	
function doFirst(){
		 	if(${aa}==1){
					
				$("#div1").hide();
				} 
		
}

</script>
<body onload="doFirst()">

		<#include "/view/admin/listnav.html"/> 
	

<div class="table-class">
    <#include "/view/admin/opermsg.html"/>
			<form class="form-horizontal" role="form"  name="form1" action="${base}/festivalact/doAdd" method="post" enctype="multipart/form-data" style="margin-top: 20px">
		<table class="table table-bordered">
				<fieldset>
					<div class="form-group">
						<input type="hidden" name="festivalActId" value="${czjfestivalact.festivalActId!?html}"/>
						<!-- <label class="col-sm-2 control-label" for="ds_host">活动主题</label>
						<div class="col-sm-4">
							<input class="form-control" id="ds_host" type="text"
								name="festTheme" value="${czjfestivalact.festTheme!?html }" onblur="validateWord()" />
						</div> -->
						<label class="col-sm-2 control-label" for="ds_host">活动名称</label>
						<div class="col-sm-4">
							<input class="form-control" id="ds_host" type="text"
								name="festName" value="${czjfestivalact.festName!?html }" />
						</div>
						<label class="col-sm-2 control-label" for="ds_host">活动金额(元)</label>
						<div class="col-sm-4">
							<input class="form-control" id="ds_host" type="text"
								name="festAmount" value="${czjfestivalact.festAmount!?html }"  onkeyup="clearNoNum(this)"/>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">活动开始时间</label>
						<div class="col-sm-4">
							<div class="input-append date begin_datetime" data-date="">
								<input size="16" name="beginTime" type="text" class="form-control"
									value="<#if (czjfestivalact.beginTime)??>${czjfestivalact.beginTime?string('yyyy-MM-dd HH:mm'  )}</#if>"
									readonly> <span class="add-on"><i
									class="icon-remove"></i></span> <span class="add-on"><i
									class="icon-calendar"></i></span>
							</div>

						</div>
						<label class="col-sm-2 control-label" for="ds_username">活动结束时间</label>
						<div class="col-sm-4">
							<div class="input-append date end_datetime" data-date="">
								<input size="16" name="endTime" type="text"  class="form-control"
									value="<#if (czjfestivalact.endTime)??>${czjfestivalact.endTime?string('yyyy-MM-dd HH:mm'  )}</#if>"
									readonly> <span class="add-on"><i
									class="icon-remove"></i></span> <span class="add-on"><i
									class="icon-calendar"></i></span>
							</div>
						</div>
					</div>

					<div class="form-group">
								<label class="col-sm-2 control-label" for="ds_name">活动地点</label>
						<div class="col-sm-4">
							<input class="form-control" id="ds_name" type="text" name="venue"
								value="${czjfestivalact.venue!?html }" />
						</div>
					<!-- 	<label class="col-sm-2 control-label" for="ds_host">活动类型</label>
						<div class="col-sm-4">
							<div class="col-lg-10">
								<select id="basic" name="festType"
									class="selectpicker show-tick form-control"
									data-live-search="true">
									<option value="1" <#if czjfestivalact.festType ??  && czjfestivalact.festType==1>selected</#if>>线上活动</option>
									<option value="0" <#if czjfestivalact.festType ??  && czjfestivalact.festType==0>selected</#if>>线下活动</option>
								</select>
							</div>
						</div> -->
						<label class="col-sm-2 control-label" for="ds_host">活动是否可预定</label>
						<div class="col-sm-4">

							<span class="label-write"> 
							<input name="reserve" type="hidden" value="<#if czjfestivalact.reserve??>${czjfestivalact.reserve}<#else>0</#if>"/>
							<input name="onreserve"
								type="checkbox" data-size="small"
								<#if czjfestivalact.reserve??>
                        <#if 1==czjfestivalact.reserve>
                            checked="checked"
                            value="1"</#if>
                        <#if 0==czjfestivalact.reserve>
                            value="0"</#if>
          				  </#if>/>
							</span>
						</div>
					</div>
					
					
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">活动代言人姓名</label>
						<div class="col-sm-4">
						<!-- 	<input class="form-control" id="ds_username" type="text"
								name="nickName" value="${czjfestivalact.nickName!?html }" /> -->
									<input type="hidden" id="nickName"name="nickName" value="${czjfestivalact.nickName!?html }" /> 
								  <div class="form-group">
                        <select id="czjUserInfoId" name="czjUserInfoId"
                                class="form-control selectpicker"   data-live-search="true" onchange="doChange(this.options[this.options.selectedIndex].value)"
                        >				
                        <option value="-1">请选择代言人</option>
                                     <#list czjxyspokesmans as lv>
                                        <option value="${lv.spokesmanId!}"
                                        <#if lv.spokesmanId??&&czjfestivalact.czjUserInfoId??&&czjfestivalact.czjUserInfoId == lv.spokesmanId >
                                            selected="selected"
                                        </#if>
                                            >${lv.nickName!}</option>
                                    </#list>

                        </select>
                    </div>
                    <script>
                    
                  
                 
                    	function doChange(spokesmanId){
                    		if(-1==spokesmanId){
                    			
                    			 $('#head').attr("src","");
                    			$("input[name='picPath']").val("");
                    			$("input[name='nickName']").val("");
                    			$("input[name='nickName']").val("");
                    			$('#head1').val("");
                    			 $("#div1").hide();
                    		}else{
                    		
                    		$
            				.ajax( {
            					url : "getSpokesman",
            					data : {
            						"spokesmanId" : spokesmanId
            					},
            					dataType : "json",
            					type : "get",
            					success : function(data) {
            						if(data.status==0){
            							alert("服务器错误");
            						}else{
            							var nickName=data.result.nickName;
            							var picPath=data.result.picPath;
            							var netVideURL=data.result.netVideURL;
            							$("input[name='festVideo']").val(netVideURL);
            							 $('#head1').val(picPath);
            							var base=$("#base").val();
            							var picPath=base+picPath;
            							$("#nickName").val(nickName);
            							 $('#head').attr("src",picPath);
            							 $("#div1").show();
            							 
            							
            						}
            					},
            					error : function() {
            						alert("服务器错误");
            					}

            				});
                    		
                    	}
                    		
                    	}
                    </script>
								
								
						</div>
						<label class="col-sm-2 control-label" for="ds_username">活动视频URL</label>
						<div class="col-sm-4">
							<!-- <input class="form-control" id="ds_username" type="text"
								name="festVideo" value="${czjfestivalact.festVideo!?html }" /> -->
								
								<textarea class="form-control" rows="3"  id="ds_username" type="text"
								name="festVideo">${czjfestivalact.festVideo!?html }</textarea>
						</div>
					</div>
					<!-- <div class="form-group">
						<label class="col-sm-2 control-label" for="ds_host">活动金额(元)</label>
						<div class="col-sm-4">
							<input class="form-control" id="ds_host" type="text"
								name="festAmount" value="${czjfestivalact.festAmount!?html }"  onkeyup="clearNoNum(this)"/>
						</div>
						<label class="col-sm-2 control-label" for="ds_name">活动优惠价格(元)</label>
						<div class="col-sm-4">
							<input class="form-control" id="ds_name" type="text"
								name=favorablePrice
								value="${czjfestivalact.favorablePrice!?html }" onkeyup="clearNoNum(this)"/>
						</div>
					</div> -->
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">是否显示在首页</label>
						<div class="col-sm-4">
						
							<span class="label-write"> 
							   <input name="ext4" type="hidden" value="<#if czjfestivalact.ext4??>${czjfestivalact.ext4}<#else>0</#if>"/>
							<input name="ext4cd"
								type="checkbox" data-size="small"
								<#if czjfestivalact.ext4??>
                        <#if 1==czjfestivalact.ext4>
                            checked="checked"
                            value="1"</#if>
                        <#if 0==czjfestivalact.ext4>
                            value="0"</#if>
          				  </#if>/>
							</span>
  							
								
						</div>
						
						<label class="col-sm-2 control-label" for="ds_host">评论开关</label>
						<div class="col-sm-4">

							<span class="label-write"> 
							   <input name="onOff" type="hidden" value="<#if czjfestivalact.onOff??>${czjfestivalact.onOff}<#else>0</#if>"/>
							<input name="onOffcd"
								type="checkbox" data-size="small"
								<#if czjfestivalact.onOff??>
                        <#if 1==czjfestivalact.onOff>
                            checked="checked"
                            value="1"</#if>
                        <#if 0==czjfestivalact.onOff>
                            value="0"</#if>
          				  </#if>/>
							</span>
						</div>
					</div>
					
					<div class="form-group">
					
						<label class="col-sm-2 control-label" for="ds_host">活动说明</label>
							<div class="col-sm-10">
							<!-- <input class="form-control" id="ds_username" type="text"
								name="fastExplain" value="${czjfestivalact.fastExplain!?html }" /> -->
								
							<textarea class="form-control" rows="3" name="fastExplain" >${czjfestivalact.fastExplain!?html }</textarea>
  							
								
						</div>
					</div>
					
					
						<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_host">活动链接</label>
						<div class="col-sm-10">
						
						<textarea class="form-control" rows="3" name="festUrl"  placeholder="如果你输入了活动链接,活动详情将优先加载链接的内容">${czjfestivalact.festUrl!?html }</textarea>
							<!-- <input class="form-control" id="ds_host" type="text" 
								name="festUrl" value="${czjfestivalact.festUrl!?html }" /> -->
						</div>
				<!-- 		<div class="col-sm-4">	如果你输入了活动链接,活动详情将优先加载链接的内容. -->
							<div class="col-lg-10">
						
								<!-- <select id="basic" name="festType"
									class="selectpicker show-tick form-control"
									data-live-search="true">
									<option value="0" <#if czjfestivalact.festType ??  && czjfestivalact.festType==0>selected</#if>>线下活动</option>
									<option value="1" <#if czjfestivalact.festType ??  && czjfestivalact.festType==1>selected</#if>>线上活动</option>
								</select> -->
							</div>
						</div> 
					</div>
					
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">活动详情大图 &nbsp; &nbsp;<br/>750px*auto</label>
						<div class="col-sm-4">

							<span class="label-write"><input id="picPath" type="file"
								name="pp"/> </span>
								
						</div>
						
								<label class="col-sm-2 control-label" for="ds_host"><#if czjfestivalact.festivalActId ??>原活动详情大图</#if></label>
						<div class="col-sm-4">

							<span class="label-write">
								<#if czjfestivalact.festivalActId ?? && czjfestivalact.festPic ??>
      							 <img src="<#if czjfestivalact.festPic ??>${base}${czjfestivalact.festPic?html}</#if>"  width="180" height="150" />
								</#if>
							</span>
						</div>
					</div>
						
						
						<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">推荐在首页的图片 &nbsp; &nbsp;<br/>597px*326px</label>
						<div class="col-sm-4">

							<span class="label-write"><input id="festPicOne" type="file"
								name="pp"/> </span>
								
						</div>
						
								<label class="col-sm-2 control-label" for="ds_host"><#if czjfestivalact.festivalActId ??>原推荐在首页的图片</#if></label>
						<div class="col-sm-4">

							<span class="label-write">
								<#if czjfestivalact.festivalActId ?? && czjfestivalact.festPicOne ??>
      							 <img src="<#if czjfestivalact.festPicOne ??>${base}${czjfestivalact.festPicOne?html}</#if>"  width="180" height="150" />
								</#if>
							</span>
						</div>
					</div>
				
						
						<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">列表大图 &nbsp;&nbsp;<br/>710px*520px</label>
						<div class="col-sm-4">

							<span class="label-write"><input id="festPicTwo" type="file"
								name="pp"/> </span>
								
						</div>
						
								<label class="col-sm-2 control-label" for="ds_host"><#if czjfestivalact.festivalActId ??>原列表大图</#if></label>
						<div class="col-sm-4">

							<span class="label-write">
								<#if czjfestivalact.festivalActId ?? && czjfestivalact.festPicTwo ??>
      							 <img src="<#if czjfestivalact.festPicTwo ??>${base}${czjfestivalact.festPicTwo?html}</#if>"  width="180" height="150" />
								</#if>
							</span>
						</div>
					</div>
					
						
						<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">列表小图&nbsp;&nbsp;<br/>597px*326px</label>
						<div class="col-sm-4">

							<span class="label-write"><input id="detailsImg" type="file"
								name="pp"/> </span>
								
						</div>
						
								<label class="col-sm-2 control-label" for="ds_host"><#if czjfestivalact.festivalActId ??>原列表小图</#if></label>
						<div class="col-sm-4">

							<span class="label-write">
								<#if czjfestivalact.festivalActId ?? && czjfestivalact.detailsImg??>
      							 <img src="<#if czjfestivalact.detailsImg??>${base}${czjfestivalact.detailsImg?html}</#if>"  width="180" height="150" />
								</#if>
							</span>
						</div>
					</div>
					
					
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">活动使用说明图片&nbsp;&nbsp;750px*auto</label>
						<div class="col-sm-4">

							<span class="label-write"><input id="actDescPic" type="file"
								name="pp"/> </span>
								
						</div>
						
								<label class="col-sm-2 control-label" for="ds_host"><#if czjfestivalact.actDescPic ??>原活动使用说明图片</#if></label>
						<div class="col-sm-4">

							<span class="label-write">
								<#if czjfestivalact.festivalActId ?? && czjfestivalact.actDescPic ??>
      							 <img src="<#if czjfestivalact.actDescPic??>${base}${czjfestivalact.actDescPic?html}</#if>"  width="180" height="150" />
								</#if>
							</span>
						</div>
					</div>
					
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">二维码使用说明&nbsp;&nbsp;750px*auto</label>
						<div class="col-sm-4">

							<span class="label-write"><input id="qRcodePic" type="file"
								name="pp"/> </span>
								
						</div>
						
								<label class="col-sm-2 control-label" for="ds_host"><#if czjfestivalact.qRcodePic ??>原二维码使用说明</#if></label>
						<div class="col-sm-4">

							<span class="label-write">
								<#if czjfestivalact.festivalActId ?? && czjfestivalact.qRcodePic??>
      							 <img src="<#if czjfestivalact.qRcodePic??>${base}${czjfestivalact.qRcodePic?html}</#if>"  width="180" height="150" />
								</#if>
							</span>
						</div>
					</div>
					
				
						
							<#if czjfestivalact.festivalActId ??>
							<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">活动说明图片&nbsp;&nbsp;750px*auto</label>
						<div class="col-sm-10">

							<span class="label-write"><input id="festpicId" type="file"  multiple
								name="file"/> </span>
								
								
						</div>
						
						
					</div>
						
						
						
						<div class="form-group">
					
						
								<label class="col-sm-2 control-label" for="ds_host"><#if czjfestivalact.festivalActId ??>原活动说明图片</#if></label>
						<div class="col-sm-10">

							
							
			<!-- 				 <#list czjfestpics as list>
                    <div style="width: 190px;height: 190px;float: left ;margin-left: 10px;">
                     <div style="width:180px; height: 180px;  margin-top: 5px; margin-left: 5px">
                     <#if list.picPath ??>
            			<div style="width:150px; height: 150px;  margin-top: 5px; margin-left: 5px">
                          <img alt="" src="${base}${list.picPath!}" width="150px" height="150px"/>
                         </div>
                         </br>
                        <div style="width: 40px;height:40x; margin-left:60px;margin-top: 5px">
                         <a href="javascript:doDelete('${list.festpicId!}','${czjfestivalact.festivalActId!}')" class="btn btn-primary">删除</a>
                     	   <input type="text" name="sequ" value="${list.sequ!}" placeholder="请输入顺序" onblur="doVal(this.value)" style="height:30px;width:80px">
                          <input type="hidden" name="festpicId" value="${list.festpicId!}" />
                        </div>
                        </#if>
                       </div>
                     </div>
                    </#list> -->
                     <#list czjfestpics as list>
              		        
              		          <div style="width: 190px;height: 210px;float: left ;margin-left: 10px;">
                     <div style="width:180px; height: 180px; margin-top: 5px; margin-left: 5px">
            			<div style="width:150px; height: 150px;  margin-top: 5px; margin-left: 5px">
                                     <img alt="" src="${base}${list.picPath!}" width="150px" height="150px"/>
                         </div>
                         <br/>
                         <a href="javascript:doDelete('${list.festpicId!}','${czjfestivalact.festivalActId!}')" class="btn btn-primary">删除</a>
                     	   <input type="text" name="sequ" value="${list.sequ!}" placeholder="请输入顺序" onblur="doVal(this.value)" style="height:30px;width:80px">
                          <input type="hidden" name="festpicId" value="${list.festpicId!}" />
                       </div>
                     </div>
                       
                    </#list>
						</div>
					</div>
					
						
						</#if>
						
						<script>
							
						function doVal(num){
							if(""!=num){
							var tt=/^\d+$/g;
							if(tt.test(num)){
							}else{
								
							alert('请输入正整数');
							$("input[name='sequ']").val("");
								} 
							}
							
						}
						
						</script>
						
						
						<div class="form-group">
							<div id="div1">
				<!-- 		<label class="col-sm-2 control-label" for="ds_username">代言人圆形头像</label> -->
						<div class="col-sm-4">
					
				
				
							<input type="hidden"  id="base" value="${base}">
							<input type="hidden"  name="head" id="head1" value="${czjfestivalact.ext2!}">
							<!-- <img src="${base}${czjfestivalact.ext2!}"  id="head" width="150px" height="150px"> -->
							</div>
						<div>
						</div>
						</div>
			
						</div>
					


					
					
					<div class="form-group" style="text-align: center;">
						<label class="col-sm-12 " for="ds_username">
						<#if czjfestivalact.festivalActId ??>
							<button class="btn btn-success "  onclick="doSubmit()" type="button">提交</button>
							<#else>
							<button class="btn btn-success "  onclick="doSubmit()" type="button">下一步</button>
						</#if>
					   <span style="width: 20px;">&nbsp;</span>
							<!-- <button class="btn btn-danger "  onclick="doBack()"  type="button">返回</button> -->
						</label>
					</div>
					
					

		</fieldset>


</table>
		</form>


<script type="text/javascript">
	
			function doSubmit(){
				
				
				/* var festTheme=$("input[name='festTheme']").val(); */
				var festName=$("input[name='festName']").val();
				var venue=$("input[name='venue']").val();
				var beginTime=$("input[name='beginTime']").val();
				var endTime=$("input[name='endTime']").val();
				var festType=$("input[name='festType']").val();
				var festAmount=$("input[name='festAmount']").val();
				var favorablePrice=$("input[name='favorablePrice']").val();
				var head=$("input[name='head']").val();
				var options=$("#czjUserInfoId option:selected");  //获取选中的项
				   if(options.val()==-1){
					   
					  /* alert("请选择活动代言人");
					  return ; */
				  }  
				if(head.length<10){
					$("input[name='head']").val("");
				}
			/* 	if(festTheme==""){
					alert("活动主题不能为空！"); 
					  return false; 
				} */
				if(festName==""){
					alert("活动名称不能为空！"); 
					  return false; 
				}
				if(venue==""){
					alert("活动地点不能为空！"); 
					  return false; 
				}
				
				 if(beginTime==""){
					 alert("开始时间不能为空！"); 
					  return false; 
				 }
				 if(endTime==""){
					 alert("结束时间不能为空！"); 
					  return false; 
				 }
				 var d1 = new Date(beginTime.replace(/\-/g, "\/")); 
				 var d2 = new Date(endTime.replace(/\-/g, "\/")); 

				  if(d1 >=d2) 
				 { 
				  alert("开始时间不能大于结束时间！"); 
				  return false; 
				 }
			
	
				 document.form1.submit();
				  
			}
			
			function clearNoNum(obj)  
			{  
			   obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符  
			   obj.value = obj.value.replace(/^\./g,"");  //验证第一个字符是数字而不是.  
			  obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的  
			  obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");  
			  obj.value=obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3');//只能输入两个小数  
			}  
			
			function doBack(){
				history.back();
			}

</script>

	</div>
</body>
</html>

<script type="text/javascript">
	$(".begin_datetime")
			.datetimepicker(
					{
						language : 'zh-CN',//显示中文
						format : "yyyy-mm-dd hh:ii",
						autoclose : true,
						todayBtn : true,
						/* startDate : "<#if (czjfestivalact.beginTime)??>${czjfestivalact.beginTime?string('yyyy-MM-dd HH:mm'  )}</#if>", */
						minuteStep : 10
					});
</script>

<script type="text/javascript">
	$(".end_datetime")
			.datetimepicker(
					{
						language : 'zh-CN',//显示中文
						format : "yyyy-mm-dd hh:ii",
						autoclose : true,
						todayBtn : true,
						/* startDate : "<#if (czjfestivalact.beginTime)??>${czjfestivalact.beginTime?string('yyyy-MM-dd HH:mm'  )}</#if>", */
						minuteStep : 10
					});
</script>



<script type="text/javascript">
	$(function() {

		$('#picPath').fileinput({
			language : 'zh', //设置语言
			 allowedFileExtensions : ['jpg', 'png','gif','jpeg'],//接收的文件后缀
			showUpload : false, //是否显示上传按钮
			showCaption : false,//是否显示标题
			browseClass : "btn btn-primary", //按钮样式
			previewFileIcon : "<i class='glyphicon glyphicon-king'></i>",
		});
		$('#actDescPic').fileinput({
			language : 'zh', //设置语言
			 allowedFileExtensions : ['jpg', 'png','gif','jpeg'],//接收的文件后缀
			showUpload : false, //是否显示上传按钮
			showCaption : false,//是否显示标题
			browseClass : "btn btn-primary", //按钮样式
			previewFileIcon : "<i class='glyphicon glyphicon-king'></i>",
		});
		$('#qRcodePic').fileinput({
			language : 'zh', //设置语言
			 allowedFileExtensions : ['jpg', 'png','gif','jpeg'],//接收的文件后缀
			showUpload : false, //是否显示上传按钮
			showCaption : false,//是否显示标题
			browseClass : "btn btn-primary", //按钮样式
			previewFileIcon : "<i class='glyphicon glyphicon-king'></i>",
		});
		
		$('#ext2').fileinput({
			language : 'zh', //设置语言
			 allowedFileExtensions : ['jpg', 'png','gif','jpeg'],//接收的文件后缀
			showUpload : false, //是否显示上传按钮
			showCaption : false,//是否显示标题
			browseClass : "btn btn-primary", //按钮样式
			previewFileIcon : "<i class='glyphicon glyphicon-king'></i>",
		});
		
		$('#festPicOne').fileinput({
			language : 'zh', //设置语言
			 allowedFileExtensions : ['jpg', 'png','gif','jpeg'],//接收的文件后缀
			showUpload : false, //是否显示上传按钮
			showCaption : false,//是否显示标题
			browseClass : "btn btn-primary", //按钮样式
			previewFileIcon : "<i class='glyphicon glyphicon-king'></i>",
		});
		$('#festPicTwo').fileinput({
			language : 'zh', //设置语言
			 allowedFileExtensions : ['jpg', 'png','gif','jpeg'],//接收的文件后缀
			showUpload : false, //是否显示上传按钮
			showCaption : false,//是否显示标题
			browseClass : "btn btn-primary", //按钮样式
			previewFileIcon : "<i class='glyphicon glyphicon-king'></i>",
		});
		$('#detailsImg').fileinput({
			language : 'zh', //设置语言
			 allowedFileExtensions : ['jpg', 'png','gif','jpeg'],//接收的文件后缀
			showUpload : false, //是否显示上传按钮
			showCaption : false,//是否显示标题
			browseClass : "btn btn-primary", //按钮样式
			previewFileIcon : "<i class='glyphicon glyphicon-king'></i>",
		});
		
	     $('#festpicId').fileinput({
	    	  language: 'zh', //设置语言
	          allowedFileExtensions : ['jpg', 'png','gif','jpeg'],//接收的文件后缀
	          showUpload: true, //是否显示上传按钮
	          uploadUrl: '${base}/festivalact/uploadImg?festivalActId=${czjfestivalact.festivalActId!}',//上传的地址
	          showCaption: false,//是否显示标题
	          browseClass: "btn btn-primary", //按钮样式
	          maxFileCount: 20, //表示允许同时上传的最大文件个数
	          dropZoneEnabled: false,//是否显示拖拽区域
	          uploadAsync: false, //默认异步上传 
	          previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
	     
	        
	    }); 
		
	       $('[name="onOffcd"]').bootstrapSwitch({
               onText:"是",
               offText:"否",
       onColor:"success",
       offColor:"info",
       size:"small",
       onSwitchChange:function(event,state){
           if(state==true){
               $(this).val("1");
               $('[name="onOff"]').val("1");
           }else{
               $(this).val("0");
               $('[name="onOff"]').val("0");
           }
       }
   });
	       $('[name="onreserve"]').bootstrapSwitch({
               onText:"是",
               offText:"否",
       onColor:"success",
       offColor:"info",
       size:"small",
       onSwitchChange:function(event,state){
           if(state==true){
               $(this).val("1");
               $('[name="reserve"]').val("1");
           }else{
               $(this).val("0");
               $('[name="reserve"]').val("0");
           }
       }
   });
	       
	       $('[name="ext4cd"]').bootstrapSwitch({
               onText:"是",
               offText:"否",
       onColor:"success",
       offColor:"info",
       size:"small",
       onSwitchChange:function(event,state){
           if(state==true){
               $(this).val("1");
               $('[name="ext4"]').val("1");
           }else{
               $(this).val("0");
               $('[name="ext4"]').val("0");
           }
       }
   });
	       
	     
	       
	/* 	$('[name="onOffcd"]').bootstrapSwitch({
			onText : "是",
			offText : "否",
			onColor : "success",
			offColor : "info",
			size : "small",
			onSwitchChange : function(event, state) {
				if (state == true) {
					$(this).val("1");
				} else {
					$(this).val("0");
				}
			}
		}); */
	});
</script>

<script type="text/javascript">

function doDelete(festpicId,festivalActId){
		if(""==festpicId){
			alert("不能删除图片，服务器开小差了");
			
			return ;
		}
		if(""==festivalActId){
			alert("不能删除图片，服务器开小差了");
			return ;
		}
		 $
		.ajax( {
			url : "${base}/festivalact/deleteImg",
			data : {
				"festpicId" :festpicId,
				"festivalActId":festivalActId
			},
			dataType : "json",
			type : "get",
			success : function(data) {
				if(data.status==0){
					alert("服务器错误");
				}else{
					
					window.location="${base}/festivalact/goAdd?festivalActId="+festivalActId;
					
				}
			},
			error : function() {
				alert("服务器错误,服务器开小差了。。");
			}

		});
		
	} 

</script>

